﻿<Window x:Class="AmazonGlacierGUI.UI.Views.CreateNewVaultView"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:AmazonGlacier="clr-namespace:AmazonGlacierGUI.Core.Helpers.AmazonGlacier;assembly=AmazonGlacierGUI.Core"
        xmlns:System="clr-namespace:System;assembly=mscorlib" Title="Create new vault" Height="128" Width="399" WindowStartupLocation="CenterScreen" ResizeMode="NoResize">
    <Window.Resources>
        <ObjectDataProvider x:Key="regionEnum"
       MethodName="GetValues" ObjectType="{x:Type System:Enum}">
            <ObjectDataProvider.MethodParameters>
                <x:Type TypeName="AmazonGlacier:AmazonRegionEnum"/>
            </ObjectDataProvider.MethodParameters>
        </ObjectDataProvider>
    </Window.Resources>
    <Grid Margin="5">
        <StackPanel>
            <Grid>
                <Grid.RowDefinitions>
                    <RowDefinition  Height="20"></RowDefinition>
                </Grid.RowDefinitions>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="150"></ColumnDefinition>
                    <ColumnDefinition></ColumnDefinition>
                </Grid.ColumnDefinitions>
                <TextBlock Grid.Row="0" Grid.Column="0" Text="Region"></TextBlock>
                <ComboBox Grid.Row="0" Grid.Column="1" ItemsSource="{Binding Source={StaticResource regionEnum}}"
                          SelectedItem="{Binding Region,Mode=TwoWay,ValidatesOnDataErrors=True,NotifyOnValidationError=True}"
                          ></ComboBox>
            </Grid>
            <Grid Margin="0,5,0,0">
                <Grid.RowDefinitions>
                    <RowDefinition  Height="20"></RowDefinition>
                </Grid.RowDefinitions>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="150"></ColumnDefinition>
                    <ColumnDefinition></ColumnDefinition>
                </Grid.ColumnDefinitions>
                <TextBlock Grid.Row="0" Grid.Column="0" Text="Vault name"></TextBlock>
                <TextBox Grid.Row="0" Grid.Column="1" Text="{Binding VaultName,Mode=TwoWay,ValidatesOnDataErrors=True,NotifyOnValidationError=True}"
                          ></TextBox>
            </Grid>
            <StackPanel Orientation="Horizontal" Margin="150,10,0,0">
                <Button Content="Create"  Height="22" Width="80" VerticalAlignment="Top"  HorizontalAlignment="Left" Command="{Binding CreateCommand}"></Button>
                <Button Content="Close"  Height="22" Width="80" Margin="5,0,0,0" VerticalAlignment="Top"  HorizontalAlignment="Left" Command="{Binding CloseCommand}"></Button>
            </StackPanel>

        </StackPanel>
    </Grid>
</Window>
